﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IBS.Bll.Accounts;
using IBS.Bll.Authority;
using IBS.Bll.AutoPayments;
using IBS.Bll.Cards;
using IBS.Bll.KnowledgeBase;
using IBS.Bll.OperationDay;
using IBS.Bll.Payments;
using IBS.Bll.Security;
using IBS.Bll.Transfers;
using IBS.MockDac;
using IBS.Model;
using IBS.ServiceContracts;
using Ninject;

namespace IBS.MockBLL
{
    public class ServicesFactoryMock
    {
        private IKernel kernel;
        public ServicesFactoryMock()
        {
            kernel = new StandardKernel();


            kernel.Bind<IIbsContext>()
                .To<IbsContextMock>()
                .InSingletonScope();

            kernel.Bind<IAccountService>()
                         .To<AccountService>()
                         .InSingletonScope();

            
            kernel.Bind<IAddressService>()
                                  .To<AddressService>()
                                  .InSingletonScope();

            kernel.Bind<IAdmissionService>()
                .To<AdmissionServiceMock>()
                .InSingletonScope();

            kernel.Bind<IAutoPaymentService>()
                                       .To<AutoPaymentService>()
                                       .InSingletonScope();

            kernel.Bind<IAuthorityService>()
                                .To<AuthorityService>()
                                .InSingletonScope();

            kernel.Bind<ICardService>()
                .To<CardService>()
                .InSingletonScope();

            kernel.Bind<ICurrencyService>()
                              .To<CurrencyService>()
                              .InSingletonScope();

            kernel.Bind<IKnowledgeBaseService>()
                .To<KnowledgeBaseService>()
                .InSingletonScope();

            kernel.Bind<IOperationDayService>()
              .To<OperationDayService>()
              .InSingletonScope();


            kernel.Bind<IPaymentService>()
                                   .To<PaymentService>()
                                   .InSingletonScope();

            kernel.Bind<ISecurityService>()
                  .To<SecurityService>()
                  .InSingletonScope();

            kernel.Bind<IStreetService>()
                  .To<StreetService>()
                  .InSingletonScope();

            kernel.Bind<ITransferService>()
                 .To<TransferService>()
                 .InSingletonScope();
        }
        public T GetInstance<T>()
        {
            return kernel.Get<T>();
        }
    }

}
